<template>
  <div class="about">
    <div class="col-main">
      <div class="about-div">
        <div class="about-div-h2">个人基本资料</div>
        <div class="about-div-p">
          账号：{{ info.username }}<br>
          邮箱：{{ info.email }}<br>
          电话：{{ info.phone }}<br>
          性别：{{ info.sex }}<br>
          生日：{{ info.birth }}<br>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
  import axios from 'axios';
  import {
    userLogin,
    userInfo,
  } from "@/request/api";
  import { reactive, toRefs, onMounted } from 'vue';
  const data = reactive({
		info: {
      username: '',
      email: '',
      phone: '',
      sex: '',
      birth: '',
    },
	})
	const { 
		info,
	} = toRefs(data);
  onMounted(() => {
    if (localStorage.getItem('userInfos')) {
      data.info = JSON.parse(localStorage.getItem('userInfos'));
    }
    // infoList();
	})

  function infoList() {
    console.log("打击好")
    userInfo({}).then(res => {
      console.log("好了",res)
    })
		// axios({
		//     method:"POST",
		//     url: 'http://localhost:6082/api/user/login',
		//     data: param,
		//     headers: {
		//       'Content-Type': 'application/json',
		//     }
		// })
		// .then(res => {
			
		// })
		// .catch(error => {
		//     console.error("There was an error!", error);
		// });
	}
</script>

<style lang="less" scoped>
.about-div {
  width: 100%;
  padding: 16px;
  background-color: var(--bwsz-nav-bg);
  overflow: hidden;
  border-radius: 5px;
  margin-top: 10px;
  padding: 20px 30px;
  .about-div-h2 {
    width: 100%; 
    font-size: 20px;
    margin-top: 10px;
  }
  .about-div-p {
    width: 100%; 
    font-size: 16px;
    line-height: 35px;
    margin-top: 20px;
    text-align: left;
  }
}
</style>